
@model zhangmenren.Models.UserEntity

<div class="bg-gray">

    <header class="mui-bar mui-bar-nav head-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href='@Url.Action("Index","User")'></a>

        <h1 class="mui-title">个人资料</h1>
    </header>
    <!--DOM -->
    <div class="mui-content bg-gray">
        <!---->
        <ul class="mui-table-view  personalData-list personalData-head-box">
            <li class="mui-table-view-cell mui-media">
                <a class="mui-navigate-right">
                    <!--  a标签需要触发input事件 -->
                    <input type="file" class="j-head" accept="image/*" name="file" />
                    <div class="mui-media-object mui-pull-right">
                        <img src="@Model.Head">
                    </div>
                    <div class="mui-media-body">
                        头像
                    </div>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpUserName",new{username=Model.UserName})'>
                    昵称
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpSignature",new{signature=Model.Signature})'>
                    个性签名
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpJianJie",new{introduction=Model.Introduction})'>
                    自我介绍
                </a>
            </li>
        </ul>
        <ul class="mui-table-view personalData-list">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpMobile",new{mobile=Model.Mobile})'>
                    手机号
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpAddress",new{address=Model.Address})'>
                    地址
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" href='@Url.Action("UpPwd")'>
                    修改密码
                </a>
            </li>
        </ul>

    </div>
</div>

@section Scripts{
	<script>
		layui.use(['form', 'upload'], function() {
			
			var upload = layui.upload;
			
					var uploadInsts = upload.render({
						elem: '.j-head',
						url: '@Url.Action("UploadFilesAjax","Login")',
						before: function(obj) {
							
							layerm.open({
							content: "请等待图片上传完成"
							,skin: 'msg'
							,time: 2 //2秒后自动关闭
							});
							
						},
						done: function(res) {
					$.ajax({
						type: 'post',
						url: '@Url.Action("EditHead")',
						data: {
							head: res.data.src
						},
						success:function(result){
							if (result.state=="ok") {
								layerm.open({
								content: result.msg
								,btn: '确定',
								yes:function () {
									location.href='@Url.Action("Index","MyInfo")';
								}
								});
			
							}else if(result.state=="login"){
								location.href='@Url.Action("Index","Login")';
							}else{
								layerm.open({
								content: result.msg
								,btn: '确定',
								yes:function () {
									location.href='@Url.Action("Index","MyInfo")';
								}
								});
							}
						}
					})
							
							//上传成功
						},
						error: function() {
							//信息框
							layerm.open({
								content: '上传失败，请联系我们或者稍后重试',
								btn: '好的'
							});
						}
					});
			
			
		});

		
	</script>
}